3.339 \(\int \frac {\tan (e+f x)}{a+b \sec ^2(e+f x)} \, dx\)

Optimal. Leaf size=23 \[ -\frac {\log \left (a \cos ^2(e+f x)+b\right )}{2 a f} \]

[Out]

-1/2*ln(b+a*cos(f*x+e)^2)/a/f

________________________________________________________________________________________

Rubi [A]  time = 0.03, antiderivative size = 23, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 21, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.095, Rules used = {4138, 260} \[ -\frac {\log \left (a \cos ^2(e+f x)+b\right )}{2 a f} \]

Antiderivative was successfully verified.

[In]

Int[Tan[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

-Log[b + a*Cos[e + f*x]^2]/(2*a*f)

Rule 260

Int[(x_)^(m_.)/((a_) + (b_.)*(x_)^(n_)), x_Symbol] :> Simp[Log[RemoveContent[a + b*x^n, x]]/(b*n), x] /; FreeQ
[{a, b, m, n}, x] && EqQ[m, n - 1]

Rule 4138

Int[((a_) + (b_.)*sec[(e_.) + (f_.)*(x_)]^(n_))^(p_.)*tan[(e_.) + (f_.)*(x_)]^(m_.), x_Symbol] :> Module[{ff =
 FreeFactors[Cos[e + f*x], x]}, -Dist[(f*ff^(m + n*p - 1))^(-1), Subst[Int[((1 - ff^2*x^2)^((m - 1)/2)*(b + a*
(ff*x)^n)^p)/x^(m + n*p), x], x, Cos[e + f*x]/ff], x]] /; FreeQ[{a, b, e, f, n}, x] && IntegerQ[(m - 1)/2] &&
IntegerQ[n] && IntegerQ[p]

Rubi steps

\begin {align*} \int \frac {\tan (e+f x)}{a+b \sec ^2(e+f x)} \, dx &=-\frac {\operatorname {Subst}\left (\int \frac {x}{b+a x^2} \, dx,x,\cos (e+f x)\right )}{f}\\ &=-\frac {\log \left (b+a \cos ^2(e+f x)\right )}{2 a f}\\ \end {align*}

________________________________________________________________________________________

Mathematica [A]  time = 0.19, size = 26, normalized size = 1.13 \[ -\frac {\log (a \cos (2 (e+f x))+a+2 b)}{2 a f} \]

Antiderivative was successfully verified.

[In]

Integrate[Tan[e + f*x]/(a + b*Sec[e + f*x]^2),x]

[Out]

-1/2*Log[a + 2*b + a*Cos[2*(e + f*x)]]/(a*f)

________________________________________________________________________________________

fricas [A]  time = 0.53, size = 21, normalized size = 0.91 \[ -\frac {\log \left (a \cos \left (f x + e\right )^{2} + b\right )}{2 \, a f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="fricas")

[Out]

-1/2*log(a*cos(f*x + e)^2 + b)/(a*f)

________________________________________________________________________________________

giac [F(-2)]  time = 0.00, size = 0, normalized size = 0.00 \[ \text {Exception raised: NotImplementedError} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="giac")

[Out]

Exception raised: NotImplementedError >> Unable to parse Giac output: Unable to check sign: (2*pi/x/2)>(-2*pi/
x/2)2/f*(1/2/a*ln(abs((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))+1))-1/4/a*ln(((1-cos(f*x+exp(1)))/(1+cos(f*x+exp
(1))))^2*b+((1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1))))^2*a+2*(1-cos(f*x+exp(1)))/(1+cos(f*x+exp(1)))*b-2*(1-cos(
f*x+exp(1)))/(1+cos(f*x+exp(1)))*a+b+a))

________________________________________________________________________________________

maple [A]  time = 0.23, size = 37, normalized size = 1.61 \[ -\frac {\ln \left (a +b \left (\sec ^{2}\left (f x +e \right )\right )\right )}{2 f a}+\frac {\ln \left (\sec \left (f x +e \right )\right )}{f a} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(f*x+e)/(a+b*sec(f*x+e)^2),x)

[Out]

-1/2/f/a*ln(a+b*sec(f*x+e)^2)+1/f/a*ln(sec(f*x+e))

________________________________________________________________________________________

maxima [A]  time = 0.34, size = 26, normalized size = 1.13 \[ -\frac {\log \left (a \sin \left (f x + e\right )^{2} - a - b\right )}{2 \, a f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)^2),x, algorithm="maxima")

[Out]

-1/2*log(a*sin(f*x + e)^2 - a - b)/(a*f)

________________________________________________________________________________________

mupad [B]  time = 4.56, size = 63, normalized size = 2.74 \[ \frac {\mathrm {atanh}\left (\frac {a}{2\,\left (\frac {3\,a}{2}+2\,b+\frac {a\,\cos \left (2\,e+2\,f\,x\right )}{2}\right )}-\frac {a\,\cos \left (2\,e+2\,f\,x\right )}{2\,\left (\frac {3\,a}{2}+2\,b+\frac {a\,\cos \left (2\,e+2\,f\,x\right )}{2}\right )}\right )}{a\,f} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(tan(e + f*x)/(a + b/cos(e + f*x)^2),x)

[Out]

atanh(a/(2*((3*a)/2 + 2*b + (a*cos(2*e + 2*f*x))/2)) - (a*cos(2*e + 2*f*x))/(2*((3*a)/2 + 2*b + (a*cos(2*e + 2
*f*x))/2)))/(a*f)

________________________________________________________________________________________

sympy [A]  time = 12.70, size = 128, normalized size = 5.57 \[ \begin {cases} \frac {\tilde {\infty } x \tan {\relax (e )}}{\sec ^{2}{\relax (e )}} & \text {for}\: a = 0 \wedge b = 0 \wedge f = 0 \\\frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text {for}\: b = 0 \\\frac {x \tan {\relax (e )}}{a + b \sec ^{2}{\relax (e )}} & \text {for}\: f = 0 \\- \frac {1}{2 b f \sec ^{2}{\left (e + f x \right )}} & \text {for}\: a = 0 \\- \frac {\log {\left (- i \sqrt {a} \sqrt {\frac {1}{b}} + \sec {\left (e + f x \right )} \right )}}{2 a f} - \frac {\log {\left (i \sqrt {a} \sqrt {\frac {1}{b}} + \sec {\left (e + f x \right )} \right )}}{2 a f} + \frac {\log {\left (\tan ^{2}{\left (e + f x \right )} + 1 \right )}}{2 a f} & \text {otherwise} \end {cases} \]

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(tan(f*x+e)/(a+b*sec(f*x+e)**2),x)

[Out]

Piecewise((zoo*x*tan(e)/sec(e)**2, Eq(a, 0) & Eq(b, 0) & Eq(f, 0)), (log(tan(e + f*x)**2 + 1)/(2*a*f), Eq(b, 0
)), (x*tan(e)/(a + b*sec(e)**2), Eq(f, 0)), (-1/(2*b*f*sec(e + f*x)**2), Eq(a, 0)), (-log(-I*sqrt(a)*sqrt(1/b)
 + sec(e + f*x))/(2*a*f) - log(I*sqrt(a)*sqrt(1/b) + sec(e + f*x))/(2*a*f) + log(tan(e + f*x)**2 + 1)/(2*a*f),
 True))

________________________________________________________________________________________